import { defineStore } from 'pinia';
import Cookies from 'js-cookie';
import { Session } from '/@/utils/storage';

/**
 * 企业信息
 * @methods setQiyeInfos 设置企业信息
 */
export const useQiyeInfo = defineStore('qiyeInfo', {
    state: (): any => ({
        qiyeInfos: {
            thumbnailLogo: '', // 公司logo
            shortName: '',//公司简称
        },
    }),
    actions: {
        async setQiyeInfos() {
            // 存储用户信息到浏览器缓存
            if (Session.get('qiye')) {
                this.qiyeInfos = Session.get('qiye');
            }
        },
    },
});
